package com.jy.wms.common.base;


import com.jy.wms.common.SpringUtil;
import com.jy.wms.dao.WmsShipmentOrderMapper;
import org.jeecgframework.poi.handler.impl.ExcelDataHandlerDefaultImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;


public class ShipmentOrderHanlder extends ExcelDataHandlerDefaultImpl {
    WmsShipmentOrderMapper wmsShipmentOrderMapper = SpringUtil.getBean(WmsShipmentOrderMapper.class);
    private static Logger log = LoggerFactory.getLogger(WmsShipmentOrderMapper.class);
    @Override
    public void setMapValue(Map<String, Object> map, String originKey, Object value) {
        System.out.print("value:" + value);
        log.info("value:" + value);
        if(originKey!="" && originKey!=null){
            map.put(getRealKey(originKey), value != null ? value.toString() : null);
        }
    }

    private String getRealKey(String originKey) {
        log.info("originKey:" + originKey);
        if (originKey.equals("波次编号")) {
            return "bocibianhao";
        }
        if (originKey.equals("发运编号")) {
            return "fayunbianhao";
        }
        return "";
    }
}
